using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CMS.Web;
using CMS.Presenters.Views.Reports;
using CMS.Core.Domain;
using System.Collections.Generic;
using AjaxPro;
using CMS.Presenters.Presenters;

namespace CMS.Web.Reports
{
    public partial class LookupAll : BaseUserControl, ILookupAllView
    {
        IList<LoaiDon> loaiDons = new List<LoaiDon>();
        IList<PhongBan> linhVucs = new List<PhongBan>();
        bool isRole = false;
        LookupAllPresenter lookupPresenter;

        public LookupAll()
        {
            this.lookupPresenter = new LookupAllPresenter(this);            
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.RaiseClientEvent();
            this.drpPB.DataSource = this.LinhVucs;
            this.drpPB.DataBind();
            this.drpLoaiDon.DataSource = this.LoaiDons;
            this.drpLoaiDon.DataBind();
            this.drpPB.Items.Insert(0, new ListItem("", "0"));
            this.drpLoaiDon.Items.Insert(0, new ListItem("", "0"));            
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        protected void RaiseClientEvent()
        {
            Utility.RegisterTypeForAjax(typeof(CMS.Presenters.Presenters.LookupAllPresenter));
        }

        #region ILookupView Members       

        public string Message
        {
            set { throw new Exception("The method or operation is not implemented."); }
        }

        public bool IsRole
        {
            set
            {
                this.isRole = value;
            }
            get
            {
                return this.isRole;
            }

        }

        public bool IsValid
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }      

        public IList<PhongBan> LinhVucs
        {
            get
            {
                return this.linhVucs;
            }
            set
            {
                this.linhVucs = value;
            }
        }

        public IList<LoaiDon> LoaiDons
        {
            get
            {
                return this.loaiDons;
            }
            set
            {
                this.loaiDons = value;
            }
        }

        #endregion
    }
}